<template>
  <div>
    <input type="text" v-model="msg" /><button @click="add">增加</button>
  </div>
</template>
<script>
export default {
  data() {
    return {
      msg: "",
    };
  },
  methods: {
    add() {
      this.$store.commit("addList", this.msg);
      this.msg = "";
    },
  },
};
</script>
<style scoped>
input {
  width: 300px;
  height: 30px;
  margin-top: 10px;
  margin-left: 5px;
  outline: 0;
  border: 1px solid gray;
}
button {
  margin-left: 10px;
  height: 35px;
  width: 50px;
  border: 1px solid gray;
  outline: 0;
}
</style>
